#ifndef __process_monitor_h__
#define __process_monitor_h__ 1

typedef struct{
    int interval;
    int cpu_usage;
    int mem_process_used;
    int sub_process_count;
    int thread_count;
    int fd_count;
    int socket_count;

} process_threshold_t;

typedef struct {
    char timestamp[32];
    int pid;

    int cpu_count;
    float cpu_usage;
    float process_cpu_usage;

    int mem_total;
    int mem_free;
    float mem_usage;
    int process_mem_used;
    float process_mem_usage;

    int sub_process_count;
    int thread_count;

    int fd_count;
    int socket_count;

    process_threshold_t *threshold;
}process_info_t;

void* process_monitor(void* arg);
process_threshold_t* process_threshold_alloc();
void process_info_print(process_info_t* pinfo);
void process_info(process_info_t* pinfo);
void process_self_print(process_info_t *pinfo);
void get_exec_name_by_pid(int pid, char *exec_name);
void get_exec_stat_by_pid(int pid, char *exec_stat);
int get_process_count(int pid);
#endif